package com.gonsin.ta.logic.controllers.po;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("Controller统一返回结构")
public class BaseResponse<T> {

    @ApiModelProperty("返回提示内容")
    private String message;

    @ApiModelProperty("错误码")
    private int state;

    @ApiModelProperty("执行变量")
    private T data;

    public static BaseResponse result(){
        BaseResponse response = new BaseResponse();
        response.state = 200;
        return response;
    }

    public static BaseResponse result(Object data){
        BaseResponse response = new BaseResponse();
        response.state = 200;
        response.data = data;
        return response;
    }

}
